﻿Imports System.Windows

Namespace ClipboardTest.Services
    Public Class ClipboardService

        Public Function ContainsData(Of T As Class)() As Boolean
            Return Clipboard.ContainsData(GetType(T).ToString())

        End Function

        Public Sub SetData(Of T As Class)(data As T)
            Clipboard.SetData(GetType(T).ToString(), data)
        End Sub

        Public Function GetData(Of T As Class)() As T
            Return TryCast(Clipboard.GetData(GetType(T).ToString()), T)
        End Function
    End Class
End Namespace

